<template>
	<view class="cu-bar tabbar bg-white shadow foot">
		<view class="action" @click="NavChange" data-cur="home">
			<view class='cuIcon-cu-image'>
				<image :src="'/static/tabbar/home' + [PageCur == 'home'?'_cur':''] + '.png'"></image>
			</view>
			<view :class="PageCur==='home'?'text-red':'text-gray'">首页</view>
		</view>
		<view class="action" @click="NavChange" data-cur="course">
			<view class='cuIcon-cu-image'>
				<image :src="'/static/tabbar/course' + [PageCur == 'course'?'_cur':''] + '.png'"></image>
			</view>
			<view :class="PageCur==='course'?'text-red':'text-gray'">课程</view>
		</view>
		<view class="action" @click="NavChange" data-cur="about">
			<view class='cuIcon-cu-image'>
				<image :src="'/static/tabbar/about' + [PageCur == 'about'?'_cur':''] + '.png'"></image>
			</view>
			<view :class="PageCur==='about'?'text-red':'text-gray'">我的</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'custome-bar',
		methods: {
			NavChange: function(e) {
				const PageCur = e.currentTarget.dataset.cur
				uni.redirectTo({
					path: `pages/${PageCur}/index`
				})
			}
		}
	}
</script>

<style>
</style>
